
<link rel="stylesheet" href="css/combobox/Selectyze.jquery.css" type="text/css" />
<link rel="stylesheet" href="css/detail.css" type="text/css" />
   <!--start gallery -->
		<link rel="stylesheet" href="colorbox.css" />
		<!--<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>-->
		<script src="colorbox/jquery.colorbox.js"></script>
		<script>
			$(document).ready(function(){
				//Examples of how to assign the ColorBox event to elements
				$(".group1").colorbox({rel:'group1'});
				$(".group2").colorbox({rel:'group2', transition:"fade"});
				$(".group3").colorbox({rel:'group3', transition:"none", width:"75%", height:"75%"});
				$(".group4").colorbox({rel:'group4', slideshow:true});
				$(".ajax").colorbox();
				$(".youtube").colorbox({iframe:true, innerWidth:425, innerHeight:344});
				$(".iframe").colorbox({iframe:true, width:"80%", height:"80%"});
				$(".inline").colorbox({inline:true, width:"50%"});
				$(".callbacks").colorbox({
					onOpen:function(){ alert('onOpen: colorbox is about to open'); },
					onLoad:function(){ alert('onLoad: colorbox has started to load the targeted content'); },
					onComplete:function(){ alert('onComplete: colorbox has displayed the loaded content'); },
					onCleanup:function(){ alert('onCleanup: colorbox has begun the close process'); },
					onClosed:function(){ alert('onClosed: colorbox has completely closed'); }
				});
				
				//Example of preserving a JavaScript event for inline calls.
				$("#click").click(function(){ 
					$('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
					return false;
				});
			});
		</script>
     <!--end gallery -->
<div class="product">
	<div class='title_product_detail'>Nos Produit Détail</div>
    <div class="search">
        <form method="post" id="frmsearchCat" action="index.php?page=product">
        	<?php
				$sql="SELECT * FROM tbl_category WHERE public=1  ORDER BY  orders ASC";
				$result=query($sql);
			?>
            	<select name="cbocategory" class="selectyze2" onchange="frmSubmit('frmsearchCat','index.php?page=product');">
                	<!--<option value="">sélectionner la catégorie</option>-->
            <?php
					
				while($row=mysql_fetch_object($result))
				{
			?>	
					<option value="<?php echo $row->cat_id;?>"><?php echo $row->cat_name;?></option>
			<?php
				}
            ?>
            	</select>
		</form>
	<!--<script type="text/javascript" src="js/combobox/jquery.js"></script>-->
	<script type="text/javascript" src="js/combobox/Selectyze.jquery.js"></script>
	<script type="text/javascript">
		$(document).ready(function(){
			$('.selectyze1').Selectyze({
				theme : 'skype'
			});
			
			$('.selectyze2').Selectyze({
				theme : 'mac'
			});
			
			$('.selectyze3').Selectyze({
				theme : 'grey'
			});	
			
			$('.selectyze4').Selectyze({
				theme : 'firefox'
			});
			
			$('.selectyze5').Selectyze({
				theme : 'css3'
			});
			
		});
	</script>
    </div>
    <div style="clear:both;"></div>
    <div class="wraper_cat">
    	<div class="wrap_photo">
        	<?php
				//get pro_id to show only photo
				$pro_id=$_REQUEST["pro_id"];
				$sql="SELECT * FROM tbl_product WHERE pro_id='$pro_id'";
				$result=query($sql);
				$row=mysql_fetch_object($result);
			?>
            <div class="wraper_img">
                <div class="img_detail"><a class="group1" href="admin/product/<?php echo $row->photo."-g.jpg";?>" title=""> <img src="admin/product/<?php echo $row->photo."-d.jpg";?>" width="184" height="221" /></a></div>
            </div>
            <div class="wrap_gallery">
            <?php
				//get galleries by pro_id
				$sql="SELECT * FROM tbl_gallery WHERE pro_id='$pro_id'";
				$result=query($sql);
			?>
            <?php
				while($row=mysql_fetch_object($result))
				{
			?>
                    <div class="gallery">
                        <a class="group1" href="admin/gallery/<?php echo $row->photo;?>" title=""> <img src="admin/gallery/<?php echo $row->photo."-s.jpg";?>" width="78" height="89"/></a>
                    </div>
              <?php
				}
			  ?>
            </div>
       </div><!-- end wrap_photo-->
<?php
				//get galleries by pro_id
				$sql="SELECT * FROM tbl_gallery WHERE pro_id='$pro_id'";
				$result=query($sql);
				$rowPhoto=mysql_fetch_array($result);
				$photo=$rowPhoto["photo"];
		?>
        <?php
			if($photo<>"")
			{
		?>
        		<?php
				//get pro_id to show pro_name and other
				$pro_id=$_REQUEST["pro_id"];
				$sql="SELECT * FROM tbl_product WHERE pro_id='$pro_id'";
				$result=query($sql);
				$row=mysql_fetch_object($result);
				?>
               <div class="row_pro_title"><?php echo $row->pro_name;?></div> 
               <div class="row_des_title">Description</div>
               <div class="row_des">
			   	<?php //echo stripslashes($row->pro_description);
						$text=$row->pro_description;
						$show=stripslashes($text);
						$show1 = str_replace('\r\n','', $show);
						echo $text = str_replace('rn','', $show1);
				?>
               </div>
               <?php
			   		if($row->decor<>"")
					{
			   ?>	
               			<div class="row_decor_title">Decor</div>
                        <div class="row_decor">
                            <?php //echo $row->decor;
                                $sub_decor=$row->decor;
                                $re_decor=stripslashes($sub_decor);
                                $re_decor1 = str_replace('\r\n','', $re_decor);
                                echo str_replace('rn','', $re_decor1);
                            ?>
                        </div>
                        <div class="row_decor_title">Confort</div>
                        <div class="row_decor">
                        <?php //echo $firstConfort=substr($row->confort,0,325); echo $firstConfort;
                                $sub_Confort=substr($row->confort,0,325);
                                $re_Confort=stripslashes($sub_Confort);
                                $re_Confort1 = str_replace('\r\n','', $re_Confort);
                                echo str_replace('rn','', $re_Confort1);
                        ?>
                        </div>
               <?php
					}//end check Decor
               ?>
                
               <?php
			   		if($row->confort<>"")
					{
			   ?>	
               			<div class="row_confort">
							<?php 
                               // echo $secondConfort=substr($row->confort,325,1000); echo $secondConfort;	
                               $sub_ConfortSec=substr($row->confort,325,1000);
                                $re_ConfortSec=stripslashes($sub_ConfortSec);
                                $re_ConfortSec = str_replace('\r\n','', $re_ConfortSec);
                                echo str_replace('rn','', $re_ConfortSec);
                             ?>
                        </div>
                       
               <?php
					}//end check confort
               ?>
                <div class="row_contact">
                            <div style="float:right;">
                                <a href="index.php?page=contact&pro_name=<?php echo $row->pro_name;?>">   <img src="images/btn-contact.gif" /></a>
                            </div>
                </div>
        <?php
			}
			else// els photo=""
			{
		?>
        		<?php
				//get pro_id to show pro_name and other
				$pro_id=$_REQUEST["pro_id"];
				$sql="SELECT * FROM tbl_product WHERE pro_id='$pro_id'";
				$result=query($sql);
				$row=mysql_fetch_object($result);
			   ?>
			   <div class="row_pro_title"><?php echo $row->pro_name;?></div> 
			   <div class="row_des_title">Description</div>
			   <div class="row_des">
			   	<?php 
						//echo stripslashes(substr($row->pro_description,0,1000));
						$text=substr($row->pro_description,0,1000);
						$show=stripslashes($text);
						$show1 = str_replace('\r\n','', $show);
						echo $text = str_replace('rn','', $show1);
                    
					?>
               </div>
			   <div class="row_confort">
					<?php 
						//$secondDes = stripslashes($row->pro_description); echo substr($secondDes,1000,2000); 
						$sub_des=substr($row->pro_description,1000,2000);
						$re_des=stripslashes($sub_des);
						$re_des1 = str_replace('\r\n','', $re_des);
						echo str_replace('rn','', $re_des1);
					 ?>
				</div>
                 <?php
			   		if($row->decor<>"")
					{
			   	 ?>	
               			<div class="row_decor_title">Decor</div>
                        <div class="row_decor1">
                            <?php //echo $row->decor;
                                $sub_decor=$row->decor;
                                $re_decor=stripslashes($sub_decor);
                                $re_decor1 = str_replace('\r\n','', $re_decor);
                                echo str_replace('rn','', $re_decor1);
                            ?>
                        </div>	
               <?php
					}//end decor=""
			   ?>
               
				<?php
			   		if($row->confort<>"")
					{
			   	?>	
                		<div class="row_decor_title">Confort</div>
                        <div class="row_decor1">
                            <?php 
                                //echo $firstConfort=substr($row->confort,0,325); echo stripslashes($firstConfort);
                                $sub_Confort=substr($row->confort,0,325);
                                $re_Confort=stripslashes($sub_Confort);
                                $re_Confort1 = str_replace('\r\n','', $re_Confort);
                                echo str_replace('rn','', $re_Confort1);
                            ?>
                        </div>
                        <div class="row_confort">
                            <?php 
                                //echo $secondConfort=substr($row->confort,325,1000); echo stripslashes($secondConfort);
                                $sub_ConfortSec=substr($row->confort,325,1000);
                                $re_ConfortSec=stripslashes($sub_ConfortSec);
                                $re_ConfortSec = str_replace('\r\n','', $re_ConfortSec);
                                echo str_replace('rn','', $re_ConfortSec);	
                             ?>
                        </div>
				
                <?php
					}//end confort
                ?>
                
				<div class="row_contact">
					<div style="float:right;">
						<a href="index.php?page=contact&pro_name=<?php echo $row->pro_name;?>">   <img src="images/btn-contact.gif" /></a>
					</div>
				</div>
        
        <?php
			}// end else $photo=""
        ?>
    </div><!-- enc wraper_cat-->
</div><!-- enc product-->
